<div class=" content-double content-left">
    <h1>Groups</h1>
    
    <div class="frame-input">
    <table class='shaded' style="width: 100%">
    <thead>
        <tr>
            <th>Name</th>
            <th>Members</th>
            <th>Rights</th>
            <th colspan="1">&nbsp;</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach($this->groups as $group) : ?>
        <tr class="<?= $this->alternator(array("odd","even")); ?>">
            <td>    
                <b>
                <?= $this->escape($group->name); ?>
                </b>
            </td>
            <td>    
                <? if (!$group->is_default): ?> 
                    <?= count($group->findManyToManyRowset('User_Model_Users', 'User_Model_UsersGroups')) ?>
                <? else: ?>
                    <em>Everyone</em>
                <? endif; ?>
            </td>
            <td style="text-align: center;">
                <a href="<?= $this->url(array('controller'=>'group', 'action'=>'rights', 'group'=>$group->id)) ?>">
                    Rights
                </a>
            </td>
            <td style="text-align: center;">
                <a href="<?= $this->url(array('controller'=>'group', 'action'=>'edit', 'group'=>$group->id)) ?>">
                    Edit
                </a>
            </td>
        </tr>
    <?php endforeach; ?>
    </tbody>    
    </table>
        
</div>
</div>

<div class="content-half content-right">
    <h1>&nbsp;</h1>
    <div class="frame-input">
        <div class="frame-content">
            <div class="button-small">
                <a href="<?= $this->url(array('module' => 'user', 'controller' => 'group', 'action' => 'create'), null, true) ?>">Create Group</a>
            </div>
        </div>
    </div>
    
</div>